package loginAction;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {
    private String userName;
    private String passWord;
    
    public String getUserName(){
        return userName;
    }
    public void setUserName(String userName){
        this.userName=userName;
    }
    public String getPassWord(){
        return passWord;
    }
    public void setPassWord(String passWord){
        this.passWord=passWord;
    }
    public String execute() throws Exception{
        if(getUserName().equals("QQ")&&getPassWord().equals("123")){
            ActionContext ac = ActionContext.getContext();
            ac.getApplication().put("userName", getUserName());
            ac.getSession().put("userName", getUserName());
            return SUCCESS;
        }
        else{
            return INPUT;
        }
    }
}